package com.example.bootcurriculumproject.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.bootcurriculumproject.entity.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import javax.management.MXBean;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {
    //更新商品库存
    @Update("update goods set amount = #{number} where id = #{no}")
    public boolean updateForByNum(int number,String no);

    //查询商品库存量
    @Select("select amount from goods where id = #{no}")
    public int selectAmount(String no);

}
